﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rvz.Game.Main.Entities.Zombies;
using Rvz.Game.Main.Entities.Zombies.States;
using Rvz.Game.Main.Rules;
using Rvz.Game.Main.State;

namespace Rvz.Game.Main.Entities.Projectiles.States
{
    public class ZombieCollisionState : ProjectileStateBase
    {
        private readonly Zombie _collidingZombie;

        public ZombieCollisionState(Zombie collidingZombie)
        {
            _collidingZombie = collidingZombie;
        }

        public override void ProcessState(Projectile sender, GameState gameState)
        {
            _collidingZombie.AddState(new HitState(sender));
            sender.Destroy();
            ProjectileEngine.RemoveProjectile(sender);
        }
    }
}
